240 LOCATE 3,5:INPUT"BAUD RATE (75,110,150,300,600,1200,1800,2400,4800,9600) ";SPEED$:IF SPEED$="" THEN 240
260 PARITY$="N":BITS$="8":STP$="1":COMFIL$="COM1:"+SPEED$+","+PARITY$+","+BITS$+","+STP$+",CS,DS,CD":OPEN COMFIL$ AS #1:WIDTH"LPT1:",255:OPEN"SCRN:" FOR OUTPUT AS #2:CFLG=0:CLS:LOCATE 1,1,1,2,10
340 B$=INKEY$:IF B$="" THEN 380
350 IF LEN(B$)>1 THEN IF ASC(MID$(B$,2,1))=3 THEN B$=CHR$(0) ELSE GOTO 340
360 IF B$=CHR$(8) THEN B$=CHR$(BACK)
370 PRINT #1,B$;:IF HALF AND NOT MONMODE THEN PRINT#2,B$;
380 IF EOF(1) THEN 340
390 IF LOC(1)>254 THEN PAUSE=TRUE:IF NOT HOLD THEN PRINT#1,XOFF$;
400 A$=INPUT$(LOC(1),#1):FOR I=1 TO LEN(A$):C$=CHR$(ASC(MID$(A$,I,1)) AND 127):C=ASC(C$):IF MONMODE THEN GOSUB 1130:GOTO 560
450 IF C<32 AND CFLG<5 THEN GOTO 750
460 IF CFLG=0 THEN GOTO 540
470 IF CFLG=1 AND C$<>"Y" THEN CFLG=0:GOTO 560
480 IF CFLG=1 AND C$="Y" THEN CFLG=2:GOTO 560
490 IF CFLG=2 THEN ROW=C-31:CFLG=3:GOTO 560
500 IF CFLG=3 THEN COL=C-31:GOTO 680
510 IF CFLG=5 THEN GOTO 900
520 IF CFLG=6 THEN GOTO 860
530 CFLG=0
540 IF C<>0 AND C<>127 THEN PRINT C$;
550 IF C<>0 AND C<>127 AND LOGMODE THEN LPRINT C$;:LOGCNT=LOGCNT+1:IF C$<>CR$ THEN GOSUB 1210 ELSE LOGCNT=0
560 NEXT I:IF LOC(1)>0 THEN 340
580 IF PAUSE THEN PAUSE=FALSE:IF NOT HOLD THEN PRINT#1,XON$;
590 GOTO 340
600 IF ERR=68 THEN GOTO 660 ELSE VP=CSRLIN:HP=POS(0):LOCATE 24,1
610 IF ERR=57 THEN EMSG$="UART OVERRUN, FRAMING, BREAK, OR PARITY ERROR"
620 IF ERR=69 THEN EMSG$="COM1: BUFFER OVERFLOW"
630 IF ERR<>57 AND ERR<>69 THEN EMSG$="BASIC ERROR"+STR$(ERR)+" IN LINE"+STR$(ERL)
640 PRINT"*** "+EMSG$+" *** ";:SOUND 523,5:LOCATE VP,HP:IF ERR<>57 AND ERR<>69 THEN:SOUND 523,15:SOUND 32767,1:CLOSE:RESUME 100 ELSE RESUME NEXT
660 CLS:LOCATE 12,20:PRINT"*** DEVICE(S) COM1: AND/OR LPT1: NOT AVAILABLE ***":SOUND 880,36:STOP
680 IF ROW<1 THEN ROW=1 ELSE IF ROW>24 THEN ROW=24
690 IF COL<1 THEN COL=1 ELSE IF COL>80 THEN COL=80
700 IF CFLG=5 THEN LOCATE ROW:GOTO 730
710 IF CFLG=6 THEN LOCATE,COL:GOTO 730
720 LOCATE ROW,COL
730 CFLG=0:GOTO 560
750 CFLG=0:IF C=10 THEN GOTO 560
770 IF C=13 THEN GOTO 540
780 IF C=27 THEN CFLG=1:GOTO 560
790 IF C=11 THEN CFLG=5:GOTO 560
800 IF C=16 THEN CFLG=6:GOTO 560
810 IF C=7 THEN BEEP:GOTO 560
820 IF C=12 THEN CLS:IF LOGMODE THEN LPRINT FF$;:GOTO 560
830 IF C=8 AND POS(0)>1 THEN LOCATE,POS(0)-1
840 IF C=8 AND LOGMODE AND LOGCNT>0 THEN LPRINT BSP$;:LOGCNT=LOGCNT-1
850 GOTO 560
860 G=C\16:D=(C AND 15) MOD 10:COL=(G*10)+D+1:GOTO 680
900 ROW=(C AND 31)+1:GOTO 680
920 LCR=INP(&H3FB):LCR=LCR OR 64:OUT &H3FB,LCR:SOUND 32767,4:SOUND 130,1:LCR=LCR AND 191:OUT &H3FB,LCR:RETURN
1000 IF HOLD THEN KEY 1,"SCROLL " ELSE KEY 1,"HOLD"
1010 IF HOLD THEN PRINT#1,XON$;ELSE PRINT#1,XOFF$;
1020 HOLD=NOT HOLD
1030 RETURN
1040 IF BACK=8 THEN BACK=127:KEY 3,"delete" ELSE BACK=8:KEY 3,"backsp"
1050 RETURN
1060 IF RVIDEO THEN COLOR 7,0:FG=7:BG=0 ELSE COLOR 0,7:FG=0:BG=7
1070 RVIDEO=NOT RVIDEO:IF RVIDEO THEN KEY 8,RT$+"BLK"+LT$ ELSE KEY 8,RT$+"WHT"+LT$
1090 RETURN
1100 CLS:RETURN
1110 IF MONMODE THEN KEY 4,RT$+"NORM"+LT$:MONMODE=FALSE:CFLG=0:RETURN
1120 MONMODE=TRUE:KEY 4,RT$+"MON"+LT$:RETURN
1130 IF C=127 THEN C$=CHR$(177) '
1140 IF C<32 THEN COLOR BG,FG:PRINT CHR$(C+64);:COLOR FG,BG ELSE PRINT C$;
1150 IF NOT LOGMODE THEN RETURN
1160 PLOG$=CHR$(C):IF C<32 THEN PLOG$=CHR$(C+64)+BSP$+UL$+BSP$+UL$
1180 IF C=127 THEN PLOG$="H"+BSP$+"O"+BSP$+"X"+BSP$+"#"+BSP$+"*"